package com.aspose.cells;

import java.util.HashMap;

class zazy {
   private zcfb a;
   private zcfc b;
   private zaas c;
   private boolean d;
   private HashMap e;

   zazy(WorksheetCollection var1, boolean var2) {
      this.d = var2;
      if (var2) {
         this.c = new zaas(var1);
         this.b = new zcfc(var1);
      } else {
         this.a = new zcfb(var1);
      }

      this.e = new HashMap();

      for(int var3 = 0; var3 < var1.getCount(); ++var3) {
         this.e.put(var1.get(var3).l(), var3);
      }

   }

   void a(zazp var1) {
      if (this.d) {
         zabd var2;
         if (var1.c == null && var1.b() != null) {
            var2 = this.c.a(var1.b(), 1);
            this.b.a(0, 0, 0, 0);
            var1.c = this.b.a(var2, 32, 2, true);
         }

         if (var1.d == null && var1.c() != null) {
            var2 = this.c.a(var1.c(), 1);
            this.b.a(0, 0, 0, 0);
            var1.d = this.b.a(var2, 32, 2, true);
         }
      } else {
         if (var1.c != null && var1.c.length > 8 && var1.b() == null) {
            var1.a(this.a.a(-1, -1, var1.c, 0, 0, false));
         }

         if (var1.d != null && var1.d.length > 8 && var1.c() == null) {
            var1.b(this.a.a(-1, -1, var1.d, 0, 0, false));
         }
      }

   }

   void a(int var1, zazl var2) {
      if (var2 != null) {
         if (this.d) {
            if (var2.h == null && var2.g != null) {
               zabd var3 = this.c.a(var2.g, 1);
               Object var4 = this.e.get(var1);
               int var5 = var4 == null ? 0 : (Integer)var4;
               this.b.a(var5, var2.b, var2.c, 0);
               var2.h = this.b.a(var3, 64, 0, true);
            }
         } else if (var2.h != null && var2.g == null) {
            var2.g = this.a.a(-1, -1, var2.h, var2.b, var2.c, false);
         }

      }
   }
}
